package com.leonzhangxf.user.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author leonzhangxf
 */
@FeignClient(name = "service-code", path = "/code", fallback = CodeApiFallback.class)
@Component
public interface CodeApi {

    /**
     *
     * @return 校验验证码是否正确，0正确1错误2超时
     */
    @GetMapping("/validate/{email}/{code}")
    Integer validate(
        @PathVariable("email") String email,
        @PathVariable("code") String code
    );
}
